﻿@model Cl.AuthorityManagement.Model.Mvc.UserEdit

@{
    Layout = null;
}

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title" id="modelTitle">@ViewBag.Operate 用户</h4>
</div>
<form action="@ViewBag.Action/User" id="modelForm" method="post" enctype="multipart/form-data" 
      data-ajax="true" data-ajax-success="saveSuccess" data-ajax-failure="saveFailure">
    @Html.AntiForgeryToken()

    <div class="modal-body form-horizontal" id="modify">
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.ID, new { @data_bind = "value:Id" })

        <div class="form-group">
            @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Name", @placeholder = @Html.DisplayNameFor(model => model.Name) } })
                @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.UserName, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.UserName, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:UserName", @placeholder = @Html.DisplayNameFor(model => model.UserName) } })
                @Html.ValidationMessageFor(model => model.UserName, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Password", @placeholder = @Html.DisplayNameFor(model => model.Password) } })
                @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PhoneNumber, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PhoneNumber, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:PhoneNumber", @placeholder = @Html.DisplayNameFor(model => model.PhoneNumber) } })
                @Html.ValidationMessageFor(model => model.PhoneNumber, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.IsCanUse, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <div class="checkbox">
                    <label>
                        @Html.CheckBoxFor(model => model.IsCanUse, htmlAttributes: new { @data_bind = "checked:IsCanUse" })
                        @Html.ValidationMessageFor(model => model.IsCanUse, "", new { @class = "text-danger" })
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" id="close_edit" class="btn btn-primary" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-success">保存</button>
        <input type="hidden" id="page" name="page" />
    </div>
</form>

<script type="text/javascript">
    $.validator.unobtrusive.parse('form');
</script>
